<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="newsDB.*,newsEntity.*,java.sql.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/read.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function checkComment(){
		var cauthor = document.getElementById("cauthor");
		var content = document.getElementById("ccontent");
		if(cauthor.value == ""){
			alert("用户名不能为空！！");
			return false;
		}else if(content.value == ""){
			alert("评论内容不能为空！！");
			return false;
		}
		return true;
	}
</script>
</head>


<div id="container">
  


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<div class="sidebar">
    <h1> <img src="../images/title_1.gif" alt="国内新闻" /> </h1>
    <div class="side_list">
      <ul>      
       <%
      		List<News> list=null;
      		list=NewsDao.nd.NewsForNtid(1L);
      		for(News n:list){
      	%>
      		<li><a href="../news.jsp?nid=<%=n.getNid() %>"><b><%=n.getNtitle()%></b></a></li>
      	<%
      		}
      	 %> 	
      </ul>
    </div>
    <h1> <img src="../images/title_2.gif" alt="国际新闻" /> </h1>
    <div class="side_list">
      <ul>      
      <%
			list=NewsDao.nd.NewsForNtid(2L);
			for(News n:list){
      	%>
      		<li><a href="../news.jsp?nid=<%=n.getNid() %>"><b><%=n.getNtitle()%></b></a></li>
      	<%
      		}      	
      	 %>
      </ul>
    </div>
    <h1> <img src="../images/title_3.gif" alt="娱乐新闻" /> </h1>
    <div class="side_list">
      <ul>
        <%
			list=NewsDao.nd.NewsForNtid(5L);
			for(News n:list){
      	%>
      		<li><a href="../news.jsp?nid=<%=n.getNid() %>"><b><%=n.getNtitle()%></b></a></li>
      	<%
      		}      	
      	 %> 	 
      </ul>
    </div>
  </div>
  <div class="main">
    <div class="class_type"> <img src="../images/class_type.gif" alt="新闻中心" /> </div>
    <div class="content">
      <ul class="classlist">
       <%
		int pageNum=1;
		try{pageNum=Integer.parseInt(request.getParameter("pageNum"));}
		catch(Exception e){}
		Long ntid=(Long)session.getAttribute("ntid");
		Page p=NewsDao.nd.newsForTopic(ntid, pageNum);
		if(p!=null){
			List<News> newsList=p.getList();
			for(News n:newsList){
	%>
		<li><a href="../news.jsp?nid=<%=n.getNid()%>"><%=n.getNtitle() %></a></li>
	<%
	}
		}else{
	%>
	<p>没有新闻</p>
	<input type="button" onclick="javascript:history.back()" value="返回"></input>
	<%
	return;
		}
		
	 %>
	 <p>
	 	当前页数:[<%=p.getPageNum() %>/<%=p.getTotalPage() %>]&nbsp
	 	<%
	 		if(p.getTotalPage()!=1&&pageNum>1){
	 	%>
	 	<a href="showList.jsp?ntid=<%=ntid%>&pageNum=1">首页</a>
	 	<a href="showList.jsp?ntid=<%=ntid%>&pageNum=<%=pageNum-1%>">上一页</a>
	 	<%
	 		}
	 		if(p.getTotalPage()!=1&&pageNum<p.getTotalPage()){
	 	%>
	 	<a href="showList.jsp?ntid=<%=ntid%>&pageNum=<%=pageNum+1%>">下一页</a>
	 	<a href="showList.jsp?ntid=<%=ntid%>&pageNum=<%=p.getTotalPage()%>">末页</a>
	 	<%
	 		}
	 	 %>
	 </p>
      </ul>
    </div>
  </div>
</div>

<div id="friend">
  <h1 class="friend_t"> <img src="../images/friend_ico.gif" alt="合作伙伴" /> </h1>
  <div class="friend_list">
    <ul>
      <li> <a href="#">百度</a> </li>
      <li> <a href="#">谷歌</a> </li>
      <li> <a href="#">新浪</a> </li>
      <li> <a href="#">网易</a> </li>
      <li> <a href="#">搜狐</a> </li>
      <li> <a href="#">人人</a> </li>
      <li> <a href="#">中国政府网</a> </li>
    </ul>
  </div>
</div>
<div id="footer">
  <p class=""> 24小时客户服务热线：010-68988888 &#160;&#160;&#160;&#160; <a href="#">常见问题解答</a> &#160;&#160;&#160;&#160; 新闻热线：010-627488888 <br />
    文明办网文明上网举报电话：010-627488888 &#160;&#160;&#160;&#160; 举报邮箱： <a href="#">jubao@jb-aptech.com.cn</a> </p>
  <p class="copyright"> Copyright &copy; 1999-2009 News China gov, All Right Reserver <br />
    新闻中国 版权所有 </p>
</div>
</body>
</html>

</html>
